package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/9/26.
 */
@Entity
@Table(name = "arbitrate", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
//@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ArbitrateEntity extends IAcross
{
    private int aId;
    private Integer orderId;
    private Integer targetuserId;
    private Integer createId;
    private Timestamp createDate;
    private String memo;
    private Integer status;
    private List<ArbitrateEntity> arbitrateList;
    private List<AttachmentEntity>  attachlist;
    private List<ArbitrateLogEntity>  logList;
    private ArbitrateLogEntity arbitrateLogEntity;
    private Integer arbiType;
    private UserEntity seller;
    private UserEntity buyer;
    private OrderEntity orderEntity;

    public ArbitrateEntity()
    {
        super();
    }

    public ArbitrateEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "a_id")
    @GeneratedValue
    public int getaId() {
        return aId;
    }

    public void setaId(int aId) {
        this.aId = aId;
    }

    @Basic
    @Column(name = "order_Id")
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "targetuser_id")
    public Integer getTargetuserId() {
        return targetuserId;
    }

    public void setTargetuserId(Integer targetuserId) {
        this.targetuserId = targetuserId;
    }

    @Basic
    @Column(name = "create_Id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArbitrateEntity that = (ArbitrateEntity) o;

        if (aId != that.aId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (orderId != null ? !orderId.equals(that.orderId) : that.orderId != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (targetuserId != null ? !targetuserId.equals(that.targetuserId) : that.targetuserId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = aId;
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (targetuserId != null ? targetuserId.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<ArbitrateEntity> getArbitrateList() {
        return arbitrateList;
    }

    public void setArbitrateList(List<ArbitrateEntity> arbitrateList) {
        this.arbitrateList = arbitrateList;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<AttachmentEntity> getAttachlist() {
        return attachlist;
    }

    public void setAttachlist(List<AttachmentEntity> attachlist) {
        this.attachlist = attachlist;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public ArbitrateLogEntity getArbitrateLogEntity() {
        return arbitrateLogEntity;
    }

    public void setArbitrateLogEntity(ArbitrateLogEntity arbitrateLogEntity) {
        this.arbitrateLogEntity = arbitrateLogEntity;
    }

    @Basic
    @Column(name = "arbi_type")
    public Integer getArbiType() {
        return arbiType;
    }

    public void setArbiType(Integer arbiType) {
        this.arbiType = arbiType;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<ArbitrateLogEntity> getLogList() {
        return logList;
    }

    public void setLogList(List<ArbitrateLogEntity> logList) {
        this.logList = logList;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public UserEntity getSeller() {
        return seller;
    }

    public void setSeller(UserEntity seller) {
        this.seller = seller;
    }
    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public UserEntity getBuyer() {
        return buyer;
    }

    public void setBuyer(UserEntity buyer) {
        this.buyer = buyer;
    }

    @Transient
    public OrderEntity getOrderEntity() {
        return orderEntity;
    }

    public void setOrderEntity(OrderEntity orderEntity) {
        this.orderEntity = orderEntity;
    }
}
